<?php


namespace app\api\validate;


use think\Validate;

class PayValidate extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'platform' => ['require', 'in:pc,mini,app'],
        'pay_type' => ['require', 'in:wallet,wxpay,alipay'],
        'paytype' => ['require', 'in:wechat,alipay'],
        'order_no' => ['require'],
        'out_trade_no' => ['require'],
    ];

    /**
     * 提示消息
     */
    protected $message = [];

    /**
     * 验证场景
     */
    protected $scene = [
        'pay' => ['platform','pay_type','order_no'],
        'pcPayQuery' => ['paytype','out_trade_no'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'platform' => '平台',
            'pay_type' => '支付方式',
            'paytype' => '支付方式',
            'order_no' => '订单号',
            'out_trade_no' => '订单号',
        ];
        parent::__construct($rules, $message, $field);
    }
}